package com.haoshuang.zhouzhoubang.ui.adapter

import com.haoshuang.zhouzhoubang.databinding.ItemWithdrawableBinding
import com.haoshuang.zhouzhoubang.model.bean.WithdrawableBean
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter
import com.mufeng.libs.utils.view.visibleOrGone


/**
 * 可提现列表
 */
class WithdrawableAdapter(data: MutableList<WithdrawableBean.WithdrawableList>) :
    BaseBindingQuickAdapter<WithdrawableBean.WithdrawableList, ItemWithdrawableBinding>(data) {

    override fun onBindViewHolder(
        holder: BaseBindingHolder,
        position: Int,
        item: WithdrawableBean.WithdrawableList?
    ) {
        holder.getViewBinding<ItemWithdrawableBinding>().apply {

            tvTime.text = item?.add_date
            tvBalance.text = "￥${item?.balance}"
            ivCheck.isSelected = item?.isChecked == true
            ivCheck.visibleOrGone(item?.is_withdraw == 1)
            tvCanWithdrawable.visibleOrGone(item?.is_withdraw == 0)

        }
    }


}
